﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using GD.ModelContest.Common;
using GD.ModelContest.Model;
using GD.ModelContest.Service;

namespace GD.ModelContest.Web
{
    public partial class NewsView : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(Request.QueryString["NewsID"]))
            {
                mc_news mcNews = ServiceLocator.INewsService.GetNewsById(int.Parse(Request.QueryString["NewsID"]));
                this.ltTitle.Text = mcNews.title;
                this.ltCreatTime.Text = mcNews.creatTime.ToShortDateString();
                this.ltContent.Text = mcNews.content;
            }
            else
            {
                Response.Redirect("NewsList.aspx?NewsType=1");
            }
        }
    }
}
